package com.wyh.controller.gfive;

import com.wyh.common.result.Result;
import com.wyh.domain.dto.gfive.PermissionNode;
import com.wyh.service.gfive.PermissionsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/permissions")
public class SysPermissionController {

    @Resource
    private PermissionsService permissionsService;

    @GetMapping("/tree")
    public Result<List<PermissionNode>> getPermissionTree() {
        List<PermissionNode> permissionTree = permissionsService.getPermissionTree();
        return Result.success(permissionTree);
    }
}

